package com.lychee.voicetranscribe;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Lychee of on 2018/3/9 15:17.
 * <p>
 * Author: HeJingzhou
 * <p>
 * Email: tcowork@163.com
 */
public class AudioData implements Parcelable {

    private double maxAmplitude;
    private double db;
    private long time;

    public AudioData(double maxAmplitude, double db, long time) {
        this.maxAmplitude = maxAmplitude;
        this.db = db;
        this.time = time;
    }

    public AudioData() {
    }

    protected AudioData(Parcel in) {
        maxAmplitude = in.readDouble();
        db = in.readDouble();
        time = in.readLong();
    }

    public static final Creator<AudioData> CREATOR = new Creator<AudioData>() {
        @Override
        public AudioData createFromParcel(Parcel in) {
            return new AudioData(in);
        }

        @Override
        public AudioData[] newArray(int size) {
            return new AudioData[size];
        }
    };

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public double getMaxAmplitude() {
        return maxAmplitude;
    }

    public void setMaxAmplitude(double maxAmplitude) {
        this.maxAmplitude = maxAmplitude;
    }

    public double getDb() {
        return db;
    }

    public void setDb(double db) {
        this.db = db;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeDouble(maxAmplitude);
        dest.writeDouble(db);
        dest.writeLong(time);
    }
}
